package com.zhaoxg.es.controller;

import com.zhaoxg.es.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author zhaoxg on 2023年02月26日 15:39
 */
@RestController
public class SearchServiceController {

    @Autowired
    private SearchService searchService;

    /**
     * currentPage 当前页码
     * pageSize 每页显示条数
     * keywords 关键字
     * isAscending 价格排序（H：从高到低、L：从低到高）
     * @param paramMap
     * @return
     */
    @ResponseBody
    @PostMapping("/search")
    public Map search(@RequestBody Map<String, String> paramMap) {
        return searchService.search(paramMap);
    }

}
